home *** CD-ROM | disk | FTP | other *** search
-
- GET27NEW.DOC - New features in GET.EXE 2.7 - Copyright 1995 Bob Stephan
-
- This file summarizes the new and improved features in GET.EXE
- Version 2.7. If you have been using an older version of GET, read
- this file to find out what has been changed, and what has been added.
-
- Some of the more interesting new features described below are:
-
- * Test for write protected diskettes (GET K, Q, and L).
- * Support for International Dates and Times (GET H and F).
- * Other new date formats that can be used to compare file
- dates or create unique file names (GET F).
- * Read and create lower case Environment variable names (&var),
- * Sound Bytes: play tones on the speaker (/S).
- * File full path or "True Name" reporting (GET FP).
- * New logical math functions (GET R).
- * Locate the boot drive (GET Y).
- * Read variables from the master Environment (GET Z).
- * Create Environment variable strings up to 255 bytes long (GET S and Z).
- * Improved reporting of information on network drives (GET K, Q, and L).
-
- Pricing, licensing, and copyright.
- ---------------------------------------------------------------
- GET 2.7 is released as shareware with a requested registration fee of
- $15 plus $2 shipping and handling to U.S.A, Canada, or Mexico, or
- $4 to other countries. Registered users of any previous version of
- GET can upgrade to registered version 2.7 for $6 plus S&H
- regardless of the number of copies authorized on a previous site
- license. All previous individual, site, and distribution licenses
- remain in effect. If you need to increase the number of copies for
- which you are licensed please contact us for incremental pricing
- information. Note that Version 2.5 was the last version that was
- released as free for non-commercial use. Registered users of any
- version of GET may use Version 2.7 shareware version for an
- unlimited time without upgrading if they so prefer.
-
- The new version of GET.EXE is temporarily named GET27.EXE to
- preclude inadvertent overwriting of previous versions. When you
- are ready to switch over to version 2.7, rename GET27.EXE to
- GET.EXE and place it in your utility directory on your path.
-
- The full manual which is now commercially produced can be included
- with new registrations or ordered later by registered users for $8.
- An additional $2 S&H is required for each manual. (Postage is getting
- more expensive). These prices are subject to change. See ORDER.GET
- for additional pricing information.
-
- The shareware version of GET will display the copyright notice the
- first time it is invoked and periodically after that as it is used.
- GET checks the Environment block to determine whether it has been
- run prior to the current call. The g$$= variable (notice the lower
- case g) is created by GET to keep track of the number of times GET
- has been called for the purpose of displaying the copyright notice.
-
- The registered runtime version never displays the copyright notice
- except when it is called with no valid arguments. The runtime version
- for registered users is under 6K in size. See additional information
- below about the runtime version.
-
- NEW AND MODIFIED FEATURES.
- ---------------------------------------------------------------
- One completely new function (see GET FP below) has been added, and
- several of the existing functions have been enhanced to provide
- many new features as described below. Help screens have been
- updated and enhanced. To see the help screens issue the GET command
- at a DOS prompt with no arguments.
-
- The GET command information below is arranged alphabetically
- according to the GET command character. But first, a discussion
- of new and changed switches and a few miscellaneous items.
-
- A problem was discovered in Version 2.62 which was released but
- rapidly withdrawn. It reported incorrect file size information in
- the ErrorLevel. Version 2.63 was released to fix the problem, but
- there may be some copies of 2.62 in circulation. Replace any
- copies of 2.62 with either 2.63 or this release. This does not
- apply to version 2.61 or earlier. No new features were added in
- 2.62 or 2.63.
-
- SWITCHES, PARAMETERS, AND OTHER NOTABLE NEW FEATURES
- -----------------------------------------------------------------
- GET Z "&var"
-
- Using "&var" in the "prompt" argument for GET Z, where 'var' is the
- name of an Environment variable, will read the named variable value
- directly from the environment without using DOS to substitute the
- value for the name. When read this way the variable name is case
- sensitive so must be entered exactly as desired. See additional
- information on the use of this feature under GET Z below.
-
- /V&var Create mixed case Environment variable names.
-
- When you use the /V switch to create a variable name, if the first
- character is an ampersand (&) the name will not be converted to
- uppercase. If you have any lowercase characters in the name, they
- will remain lowercase, thus you can use all lowercase or even mixed
- case. With the above GET Z "&var" feature, you will be able to
- read these variables, but they will not be available to most other
- DOS programs. Whether creating or reading a variable with &var,
- the & is not taken to be part of the name; however, any additional
- embedded &'s will be used as part of the name.
-
- INPUT BUFFER SIZE INCREASED
-
- The input buffer for GET S[E] and GET Z[E] is increased to 255
- characters. This allows longer strings to be input, especially for
- GET Z and GET ZE where the input might be from redirection or from
- an Environment variable. The max length of the BATch command line,
- including substitution of Environment variables is still limited by
- DOS to 128 characters - can't change that. See additional
- information on this feature under GET Z below.
-
- INTERNATIONAL DATES AND TIMES SUPPORTED
-
- The date and time functions in GET (H and F) will now report the
- dates and times in the format specified by the country code that is
- currently in use. (See additional information under GET H below.)
-
- SOUND BYTES with the /Sn switch.
-
- Additional sound control features added for use with the /Sn switch.
- As before /S or /S0 will turn off error beeps. /S1 (the default)
- is normal beeping using the ASCII 7 BEL character. Now n can also
- take on values from 2 through 255 to produce various combinations
- of sounds. This is best explained using hexadecimal input as /S$xy
- where x and y can each be from 0 through A (but must represent a
- number greater than decimal 1).
-
- Each hex digit (1-F) will produce a tone approximately 1/2 second
- long. The larger the digit, the lower the tone. A digit of 0 will
- produce no tone, thus all combinations except /S$0, /S$00, /S$1,
- and /S$01 are valid (i.e., /S$2 or /S$02 through /S$FF are valid).
- Experiment to find the ones that are pleasing to your ear.
-
- The GET EC (ECho) command will take the /Sn switch and
- unconditionally echo the specified tones with or without a "prompt"
- specified. All other commands that can produce beeps do so in
- response to an error condition or a timeout.
-
- GET C[E] and GET S[E] GET user input
- ---------------------------------------------------------------
-
- /K is a new switch to activate a countdown during the last 10 seconds
- of waiting time for /Wnum. GET C[E] and GET S[E] with the /Wn and
- /K switches for a waiting time will count the last 10 seconds as 9,
- 8, ..., 0. This gives a 10 second warning that the waiting time is
- about to expire If an invalid key is pressed during the waiting
- time, a splat, '*', (asterisk) will be displayed which will remain
- until a valid key is pressed.
-
- GET SE will now echo dots (...) instead of no echo at all.
-
- The input buffer for GET S[E] and GET Z[E] is increased to 255
- characters. This allows longer strings to be input, especially for
- GET Z and GET ZE where the input might be from redirection or from
- an Environment variable. The max length of the BATch command line,
- including substitution of Environment variables is still limited by
- DOS to 128 characters - can't change that.
-
- GET S /C now also disables the Esc key as well as Ctrl-C/Break, but
- only if the /X switch is not included. With /X the Esc key exit
- can easily be detected and appropriate action taken so disabling
- does not seem necessary. The old /~ switch for GET S has been
- completely eliminated.
-
- Additional sound control features added for use with the /Sn switch.
- See the description of the /S switch above.
-
- GET E GET Environment information
- ---------------------------------------------------------------
-
- GET E was reporting 1 too many bytes of Environment free. This has
- been corrected.
-
- GET EC ECho
- ---------------------------------------------------------------
- GET EC will take the /Sn switch described above and unconditionally
- echo the specified tones with or without a "prompt" specified. All
- other commands that can produce beeps do so in response to an error
- condition or a timeout.
-
- GET H and F Dates and times
- ----------------------------------------------------------------
- The date and time functions in GET (H and F) will now report the
- dates and times in the format specified by the country code that is
- currently in use.
-
- As an adjunct to this change, GET HE now reports the country code
- in the ErrorLevel. Previously GET HE reported the length of the
- date/time string which probably was of no use for any application.
- If the country code is greater than 254, the ErrorLevel will be
- maxed out at 255. This would affect Portugal, Finland, Israel,
- and some Arabic language countries. Note that country codes are
- usually the international telephone prefix.
-
- GET H[E] 2-digit year
-
- Code 512 has been added as an option for GET H[E]. If 512 is added
- to the coded numerical argument, the year will be placed in the
- Environment as the rightmost 2 digits only. 512 can either replace
- 8 or it can be added to 8. Either value will produce the 2-digit
- year. NOTE: Since the previous version it has been possible to obtain
- a 2-digit year by adding /R to GET H, but there was no easy way to
- do it with GET HE.
-
- GET HE/FE Date format override. The date format will
- default to the format for the country specified in DOS. You can
- override the format with the /Sn switch where n can be 0, 1, or 2
- as follows:
-
- 0 USA format Month-Day-Year
- 1 Europe format Day-Month-Year
- 2 Japan format Year-Month-Day
-
- The date separator will retain the value for the country specified
- for the operating system, but the order of the values will change
- according to these format codes. Note that the Japan format with a
- 2-digit year would be ideal for naming files because they would
- sort properly in date order. Use GET HE 518 /s2/a. However,
- countries that use a '/' or '.' character for a separator cannot
- use it in a filename. Therefore another date format feature has
- also been added. You can eliminate the separators completely by
- adding 4 to the date format code with /Sn. Thus n can also be 4,
- 5, or 6 to suppress the separators and the previous command would
- be GET HE 518 /S6. As the year 2000 rolls around you might want to
- use a 4 digit year for proper sorting. Then the command would be
- GET HE 14 /S6. The /A is not necessary with values of 4, 5, or 6
- because leading 0's will automatically be included.
-
- For example, you can create an 8 character filename incorporating
- the date with a command such as
-
- GET HE "XX" 518 /S6
-
- where XX can be any two leading characters you want. /S6 puts the
- two-digit year first to facilitate sorting, and it also eliminates
- the delimiters as well as including leading 0's.
-
- COMPRESSED DATES with the /C switch (think C for Compressed)
-
- GET H and GET F /E report dates in compressed form with /C. These
- dates can be used directly to compare the dates between two files
- or to compare a file date with today's date. This date format
- does not have much visual usefulness because it is not directly
- readable as a date. It can be used to generate unique file names
- but the names will not be meaningful to view.
-
- To report these dates use the /C switch with either GET H /C or
- GET F filespec /E/C. Other date or file parameters will be ignored
- but you can use some of the global switches such as /H to report
- the output in hexadecimal. The date format is independent of
- the Country setting and the /S switch, as well as any coded
- date parameter. These are ignored and the date is reported as
- follows. The /C switch also overrides the Extended functions of
- GET HE and GET FE/E.
-
- The format used is the DOS native internal file date format. It
- uses 16 bits as follows:
-
- BITs fedcba9 8765 43210
- Value Year Month Day
- The year is relative to 1980; e.g., 1995 is 15. Thus to convert
- to meaningful numbers it is necessary to first convert to binary
- format then extract the bit fields manually and convert to numbers.
-
- The only meaningful date arithmetic that can be done with these
- numbers is to find the number of days difference but ONLY if both
- numbers are within the same month.
-
- Examples:
-
- 1. Compare two file dates.
-
- GET F file1 /C/E/VF1=
- GET F file2 /C/E/VF2=
- GET R "=" %F1% /W%F2%
-
- Note that GET R returns the values
- 0 if F1<F2
- 1 if F1=F2
- 2 if F1>F2
-
- 2. Compare a file date with today's date.
-
- GET H /C /VTODAY=
- GET F file /C/E/VFDATE=
- GET R "=" %FDATE% /W%TODAY%
-
- Remember that the GET HE 14 function can be used to save today's
- date, then you can set the system date with the DOS DATE command,
- and finally you can reset it from the saved date. That provides
- the capability to compare a file date with any selected date.
-
- 3. Find how many days older than today the file is.
- The first check is to see if they are in the same month,
- assuming that the same month is in the current year.
-
- GET H 4 /VTODAY=
- GET F %1 /E/W4/VFDATE=
- if "%TODAY%"=="%FDATE%" goto COMPARE
- ECHO The months do not compare
- goto QUIT
- :COMPARE
- GET H /C /VTODAY=
- GET F %1 /C/E/VFDATE=
- GET R "-" %TODAY% /W%FDATE%
- Echo The file is %GET% days old
- :QUIT
-
- GET F[E] /E GET File Date
- ----------------------------------------------------------------
- See information above under GET H for new date/time formats.
-
- GET FE filespec /E/Wnum can now include seconds (code 64).
-
- GET FP This is a NEW function GET Full Path
- ----------------------------------------------------------------
- GET FP returns same information as MS-DOS 5.0's TRUENAME command.
- (GET FP requires DOS 3.0 or later).
-
- Syntax: GET FP filespec
-
- For a given filespec GET FP returns the full path leading to that
- file. Letters are converted to uppercase, and forward slashes are
- converted to backslashes; however, if you use forward slashes you
- must enclose the filespec in single quotes (e.g. 'filespec').
-
- The ErrorLevel is the subdirectory level similar to GET Y.
-
- Note that the filespec does not have to exist and this is not a
- test for existence of a given file. The full path that is returned
- will be the one to the filespec as if it did exist. If a test for
- existence is required, GET F can be applied to the result of GET
- FP, or you can use the DOS IF EXIST subcommand.
-
- If the filespec given is the name of a directory, it must end in a
- backslash (\). Examples: GET FP C:\DOS\ or GET FP \DOS\. If no
- filespec is given, the current directory on the logged drive will
- be returned. If just a drive specification is given, the colon (:)
- is required and the current directory on that drive will be
- returned.
-
- If the given path string is on a JOINed drive, the returned name is
- the one that would be needed if the drive were not JOINed.
- Similarly for a SUBSTed, ASSIGNed, or network drive letter. The
- full path on a local drive always starts with the drive letter (d:),
- those on network drives always start with \\.
-
- EXAMPLES:
-
- 1. Use GET FP to get the full path for a file named TEST.EXE.
-
- subst d: c:\util\test
- GET FP d:\test.exe
- And the result is
- C:\UTIL\TEST\TEST.EXE
-
- 2. Find the current directory on a drive other than the logged
- drive. (The colon is required).
-
- GET FP e:
- And the result is (if the current directory on E: is \CURRENT).
- E:\CURRENT
-
- 3. Find the parent directory of the current directory on drive E:
-
- GET FP E:..
- And the result is (if the current directory on E: is \CURRENT).
- E:\
- Note that the parent directory of the root directory does not
- exist so such a result would be no Environment variable and
- an ErrorLevel of 0.
-
- GET FP requires MS-DOS or PC-DOS 3.0 or above, DR DOS or Novell DOS
- 6.0 or above, or OS/2 version 2.0 or above. It may not be able to
- determine the true name if you use "nested" JOIN or SUBST commands,
- or on a network which does not report true names properly.
-
- GET K, Q, and L GET Disk information
- ----------------------------------------------------------------
- GET K, Q, and L /A switch
-
- These functions test for a readable diskette in the drive if used
- for drives A: and B:. Two methods of testing are available--
- a standard DOS method, and one that is used in an OS/2 VDM. The
- DOS method is faster in DOS but slower and less reliable under
- OS/2. If the default DOS method does not give the desired results
- for something you want to do, you can try the /A (for Alternate
- method) switch to force GET to use the same method that is used
- under OS/2. This is the method used by older versions of GET such
- as 2.5, and it can be very slow if there is an unformatted diskette
- in the drive. Remember, the two methods return different error
- codes as described in the manual.
-
- When used on drives other than A: and B: in previous versions of
- GET, this test often failed due to technical reasons even
- if valid media was in place, and it interfered with obtaining the
- size or label of some drives such as removable and network drives.
-
- GET K, Q, and L /X switch
-
- A /X switch has been added to check for a writeable disk in drive A:
- or B:. First GET checks for a formatted disk in the usual manner
- of GET Q, K, and L. If this test fails, the ErrorLevel will be 0 and
- the return code in the Environment. If this test passes, then an
- attempt is made to write to the disk, but no data will actually be
- written. If the disk is write protected an ErrorLevel of 0 and an
- Environment variable (error code) of 3 will be reported. If the
- status cannot be determined, an ErrorLevel and Environment variable
- of 0 are reported. If these tests are passed, then the normal return
- from GET K, Q, or L will be reported.
-
- The read and write tests will always be bypassed if the drive is
- other than A: or B:. This may be inconvenient for those rare users
- who have a 3rd floppy drive other than A: or B:, but it should be
- usable in 99.44% of the cases. It also does not test other types
- of drives with removable media such as Bernoulli drives. The
- benefit of this restriction is that it permits obtaining size and
- label information on more types of drives including possibly some
- network drives. This benefit is thought to more than compensate for
- the occasional Abort, Retry, Ignore type message on the odd
- removable drive other than A: or B:.
-
- GET P[E] GET Printer information
- ---------------------------------------------------------------
- GET P[E] now takes an optional prompt. Thus you can announce to
- the user what is happening without a separate Echo; e.g.
-
- GET PE "Initializing the printer"
- The usual ECho switches /N and /A can be used.
-
- GET Q[E] GET Disk Size
- ---------------------------------------------------------------
- See the information under GET K above.
-
- GET R 'Rithmetic
- ---------------------------------------------------------------
- Additional logical math functions added to GET R:
-
- & Bitwise logical AND
- Syntax: GET R "&" num1 /wnum2
- Result: num1 AND num2
-
- # Bitwise logical OR
- Syntax: GET R "#" num1 /wnum2
- Result: num1 OR num2
-
- ^ Bitwise logical XOR
- Syntax: GET R "^" num1 /wnum2
- Result: num1 XOR num2
-
- ~ Bitwise logical NOT
- Syntax: GET R "~" num1
- Result: NOT num1
-
- GET S[E] GET String
- ---------------------------------------------------------------
- See the information under GET C above.
-
- GET Y[E] Drive/Directory information
- ---------------------------------------------------------------
- BOOT DRIVE: The /X switch with GET YE reports the Boot drive using
- the same codes and format as GET YE. This feature may require DOS 4.0
- or later.
-
-
- GET Z[E] Zap
- ---------------------------------------------------------------
- The input buffer for GET S[E] and GET Z[E] is increased to 255
- characters. This allows longer strings to be input, especially for
- GET Z and GET ZE where the input might be from redirection or from
- an Environment variable. The max length of the BATch command line,
- including substitution of Environment variables is still limited by
- DOS to 128 characters - can't change that.
-
- With GET you can, for example, put a PATH longer than 128 characters
- into the Environment. While it is not recommended, it is possible.
- One way to do it with GET is to put your desired long PATH into a
- one-line text file ending in a carriage return, then read it in
- with GET. For example, if your long PATH is in the file
- LONGPATH.TXT you can use
-
- GET ZE /VPATH= <LONGPATH.TXT >NUL
-
- By redirecting the output with >NUL you suppress the echo
- that is produced by DOS when reading the file.
-
- GET Z "&VAR"
-
- This is an intriguing addition to GET which may have some interesting
- applications. Consider the following BATch file:
-
- for %%a in (1 2 3) do set var%%a=%%a
- for %%a in (1 2 3) do echo %VAR%%a%
-
- In general the echo in the second line will not echo the contents of
- VAR1, VAR2, and VAR3 because DOS does not recursively parse such a
- statement. I.e. after DOS substitutes for %%a to get %VAR1%, it
- does not again parse the line to get the value of VAR1. We could
- try several different variations of this theme, including calling
- a subroutine BATch file, but in general DOS will not parse the
- lines in the way that we would like it to.
-
- Note that we can write it so that 4DOS will parse it correctly,
- and by a convoluted method DOS can be tricked into doing it, but it
- requires echoing statements out to a temporary BATch file, and
- executing the temporary file. However, now we can do it more
- easily with GET.
-
- The new feature permits GET to read variables directly from the
- Environment, given the variable name. The above statements can
- then be written as follows to achieve the desired result:
-
- for %%a in (1 2 3) do set var%%a=%%a
- for %%a in (1 2 3) do call echoget %%a
-
- ECHOGET.BAT as called is:
-
- get z "&VAR%1"
- Echo %GET%
-
- Note the ampersand in GET Z "&VAR%1". New for GET Z is if the first
- character of the string is an '&', the remainder of the string will
- be interpreted as the name of an Environment variable to be read
- into GET's Environment variable - either GET or /Vvar=. As seen in
- the example this permits a pseudo indexing of variables; e.g. VAR1,
- VAR2, VAR3, etc. The value of each can be set into the GET
- variable to be operated on by generic BATch statements. The GET R
- function could be used to increment the index, for example.
-
- Suppose you want to operate on a list of files. The file names
- could be loaded into the environment by SETting FILE1=filename1,
- FILE2=filename2, etc. These names can be extracted by GET Z "&VAR",
- maybe something like this:
-
- @Echo off
- Rem Create a temporary auxiliary file:
- Echo GET R %%N%% /W1 /VN= >LISTFILE.BAT
- Echo GET Z "%%1" /VFILE%%N%%=>>LISTFILE.BAT
- set N=0
- Rem The next line puts the names of all the BAT files
- Rem into the Environment as FILE1, FILE2, etc.
- For %%a in (*.bat) do call listfile %%a
- del listfile.bat
- set J=0
- Rem Now for DEMO purposes, list out the file names.
- Rem They could just as easily be operated on in some way.
- :LOOP
- GET R %J% /W1 /VJ=
- GET Z "&FILE%J%"
- Echo File %J% is %GET%
- set FILE%J%=
- IF NOT "%J%"=="%N%" GOTO LOOP
- set N=
- set J=
- set GET=
-
- Another advantage of this enhancement is that long variable values
- can be transferred, which might otherwise cause the BATch command
- line to be longer than 128 bytes if DOS does the substitution; for
- example a long PATH string. The usual skip arg and /Wmax switch
- can then be used to operate on these longer strings. To
- accommodate longer strings, the input buffer has been expanded to
- 255 characters.
-
- When the /M (for Master Environment) switch is used with GET Z
- "&var", GET will look for the variable in the Master Environment,
- and if the string is found will store it in the local Environment
- (which may be the same if there is no secondary command processor,
- of course.) This is a different use of the /M switch from other
- commands, and it provides a means to retrieve a string which was
- stored in the master environment.
-
- Finally, the &var feature is case sensitive. Most Environment
- variable names are in upper case. A notable exception is the
- 'windir' variable that Microsoft Windows places in the Environment
- of DOS sessions. GET Z "&windir" will retrieve this variable if it
- is needed for some reason; however, this means the BATch programmer
- must take care to put other BATch Environment variable names in
- upper case for the &VAR feature.
-
- RUNTIME Version for Registered users
- ---------------------------------------------------------------
- The registered runtime version never displays the copyright notice
- except when it is called with no valid arguments. The runtime version
- for registered users is under 6K in size.
-
- For the convenience of registered users who are developing BATch
- files, and want to use the runtime module for development to avoid
- the periodic display of the copyright notice, the GET?=ON feature
- has been added to the runtime module. With GET?=ON either GET
- module will report the values that it places in the Environment
- and the ErrorLevel for debugging purposes.
-
- If you do use the runtime module as suggested, yet you like to have
- the help screens from the shareware module available for use, I
- suggest using one of the following methods:
-
- (a) Use redirection to capture the help screens to a file and use a
- text editor or file viewer to read the file. It is very useful
- to load this file into a window in your text editor when you
- are editing BATch files for quick reference.
-
- (b) For convenience, GET27.HLP which is a copy of the help screens
- has been included which can be used as above.
-
- (c) Keep GET27.EXE in your path and run it when you want to view the
- help screens.
- -----------------------------------------------------------------------
- Questions, comments, and suggestions are always welcome. Contact us at:
- MOBY DISK: 1021 San Carlos Road, Pebble Beach, CA 93953
- Phone: (408) 646-1899 COMPUSERVE:72357,2276 America Online: MobyDisk2
- Internet: bob.stephan@nitelog.com BBS: Nitelog 408-655-1096
- BBS: The Cricket 408-373-3773 /s/ Bob Stephan May 21, 1995
-